package cn.cheln.support.v4.pagerui;

import android.app.Activity;
import android.app.LocalActivityManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
import cn.cheln.support.v4.view.PagerView;
import cn.cheln.support.v4.view.PagerView.OnPageChangeListener;
import java.util.List;

public abstract class PagerHelper
{
  private int bmpW;
  private List<View> contentViews;
  private int currIndex = 0;
  private int defaultIndicateDuration;
  private int defaultPosition = 1;
  private int firstPositionOffset = 0;
  private ImageView indicator;
  private int initOffset;
  protected LocalActivityManager mLocalActivityManager;
  private TextView t1;
  private TextView t2;
  private int unitOffset;
  private int widthCapability = 3;
  protected Activity yourHomeActivity;

  public PagerHelper(Activity paramActivity, Bundle paramBundle)
  {
    this.yourHomeActivity = paramActivity;
    initActivityManager(paramBundle);
  }

  public static Activity getItemActivity(int paramInt, LocalActivityManager paramLocalActivityManager)
  {
    return paramLocalActivityManager.getActivity(String.valueOf(paramInt));
  }

  public void focusTouch(int paramInt)
  {
    getViewPager().setCurrentItem(paramInt);
  }

  public int getCurrIndex()
  {
    return this.currIndex;
  }

  public View.OnClickListener getOnClickListener(int paramInt)
  {
    return new TitleOnClickListener(paramInt);
  }

  public abstract PagerView getViewPager();

  public void initActivityManager(Bundle paramBundle)
  {
    this.mLocalActivityManager = new LocalActivityManager(this.yourHomeActivity, true);
    this.mLocalActivityManager.dispatchCreate(paramBundle);
    this.mLocalActivityManager.dispatchResume();
  }

  public void onDestroy()
  {
    this.mLocalActivityManager.dispatchDestroy(this.yourHomeActivity.isFinishing());
    this.contentViews.clear();
  }

  public void onPause()
  {
    this.mLocalActivityManager.dispatchPause(this.yourHomeActivity.isFinishing());
  }

  public void onResume()
  {
    this.mLocalActivityManager.dispatchResume();
  }

  public void setup(Activity paramActivity, int paramInt, List<PageInfo> paramList)
  {
    setupContent(paramList);
    paramList.size();
    getViewPager().setCurrentItem(paramInt);
    getViewPager().requestFocusFromTouch();
  }

  protected abstract void setupContent(List<PageInfo> paramList);

  public class PageChangeListener
    implements PagerView.OnPageChangeListener
  {
    private void imageSLideAnimation(int paramInt)
    {
      int l;
      if (paramInt == PagerHelper.this.currIndex)
      {
        Log.i("", "== currIndex" + PagerHelper.this.currIndex);
        return;
      }
      int i = PagerHelper.this.unitOffset * PagerHelper.this.currIndex;
      int j = paramInt * PagerHelper.this.unitOffset;
      TranslateAnimation localTranslateAnimation = new TranslateAnimation(i, j, 0.0F, 0.0F);
      PagerHelper.this.currIndex = paramInt;
      localTranslateAnimation.setFillAfter(true);
      if (PagerHelper.this.defaultIndicateDuration == -1);
      for (int k = 288; ; l = PagerHelper.this.defaultIndicateDuration)
      {
        localTranslateAnimation.setDuration(k);
        PagerHelper.this.indicator.startAnimation(localTranslateAnimation);
        return;
      }
    }

    public void onPageScrollStateChanged(int paramInt)
    {
    }

    public void onPageScrolled(int paramInt1, float paramFloat, int paramInt2)
    {
    }

    public void onPageSelected(int paramInt)
    {
    }
  }

  public class TitleOnClickListener
    implements View.OnClickListener
  {
    int index;

    public TitleOnClickListener(int paramInt)
    {
      this.index = paramInt;
    }

    public void onClick(View paramView)
    {
      PagerHelper.this.focusTouch(this.index);
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.support.v4.pagerui.PagerHelper
 * JD-Core Version:    0.5.2
 */